package com.un.ebs.sale.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.un.ebs.product.enums.ProductPurchaseTypeEnum;
import com.un.ebs.sale.domain.*;
import com.un.ebs.sale.dto.*;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author liubo
 * @since 2020-05-23
 */
public interface SaleOrderService {

    String add(SaleOrderAddDto req);

    String addByContract(String contractId);

    void update(SaleOrderUpdateDto req);

    void delete(String id);

    void submit(String id);

    void submitCancel(String id);

    void contractChange(String code);

    String saleFromContract(String contractId);

    void relationToContract(String id, String contractCode);

    SaleOutReadyDto readyOut(String contractCode);

    void saleOut(SaleOutReadyDto req);

    SaleOrder queryById(String id);

    SaleOrderVo queryViewById(String id);

    SaleOrderVo queryViewByContract(String contractId);

    IPage<SaleOrderExt> query(String searchText, Integer pageSize, Integer pageIndex);

    IPage<SaleOrderExt> queryByTempContract(String customerEntId, Integer pageSize, Integer pageIndex);

    IPage<SaleOrderItemExt> queryItem(String id, Integer pageSize, Integer pageIndex);

    IPage<SaleOrderItemExt> queryItem(SaleOrderItemQueryDto req, Integer pageSize, Integer pageIndex);

    IPage<SaleOrderItemExt> queryItemByCustomer(String customerEntId, String skuId, Integer pageSize, Integer pageIndex);

    IPage<SaleOrderItemExt> queryItemByContractCode(String contractCode,Integer pageSize,Integer pageIndex);

    IPage<SaleOrderDeliverPlanExt> queryDeliverPlan(String searchText, ProductPurchaseTypeEnum purchaseTypeEnum, Integer pageSize, Integer pageIndex);

    List<SaleOrderDeliverPlanExt> queryDeliverPlan(String skuCode);

    IPage<SaleOrderReadyDeliverExt> queryReadyDeliver(String searchText, Integer pageSize, Integer pageIndex);

    List<SaleOrderItemExt> queryReadyDeliverItem(String saleContractCode);

    List<SaleOrderExt> queryByContractCode(String code);

    IPage<SaleSummaryExt> querySummary(String searchText, int pageSize, int pageIndex);

    IPage<SaleContractNoteExt> querySaleContractNote(String entId, int pageSize, int pageIndex);

    IPage<SaleSummaryItemExt> querySummaryItem(String entId, int pageSize, int pageIndex);

    IPage<SaleReportByWeekExt> queryReportByWeek(String entId, Integer week, int pageSize, int pageIndex);

    List<SaleMonthSumExt> queryMonthSum(int year, int month);

    FinanceBySaleExt queryFinanceBySale(int year,int month);

    FinanceBySaleExt queryFinanceByService(int year,int month);

    void cancelItem(String itemId);

    void changeItem(String itemId,int sourceQty,int newQty);

    List<SaleOrderNotInvoiceView> querySaleOrderNotInvoiceByService();
}
